package com.lmmob.autotest.uitest.controls;

import org.openqa.selenium.WebDriver;

public class Tab extends CompositeControl {
    private String title;

    public Tab(String title, WebDriver webDriver) {
        super(webDriver);
        this.title = title;
    }

    @Override
    protected String getSelfQuery() {
        return String.format(".query(\"panel[title='%s']\")[0]", this.title);
    }

    @Override
    public void show() {
        runScript(this.getQuery() + ".show();");
    }

    @Override
    protected String getName(){
        return this.title;
    }
}
